//
//  ProtocolViewController.m
//  Kjs-iOS
//
//  Created by 江伟 on 16/8/22.
//  Copyright © 2016年 jmhz. All rights reserved.
//

#import "ProtocolViewController.h"
#import "KJSRequest.h"
#import "BriefResult.h"
@interface ProtocolViewController ()
@property (nonatomic,weak) IBOutlet UIWebView *contentWView;
@end

@implementation ProtocolViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.navigationItem setTitle:self.proTitle];
    //禁止弹起
    self.contentWView.scrollView.bounces = NO;
    //隐藏水平滚动条
    self.contentWView.scrollView.showsHorizontalScrollIndicator = FALSE;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [self getPlatformProtocol];
}
#pragma mark - custom method
-(void)getPlatformProtocol
{
    NSLog(@"proTpye=%@",self.proType);
    if (![self.proType isEqualToString:@""]) {
        [KJSRequest getPlatformInfoForAppWithSign:self.proType ret:^(BriefIntroModel *model) {
            NSString *content = ((BriefResult *)[model.result firstObject]).content;
            [self.contentWView loadHTMLString:content baseURL:nil];
        }];
    }
}
@end
